var __extends =
    (this && this.__extends) ||
    (function () {
      var t = function (e, i) {
        return (t =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (t, e) {
              t.__proto__ = e;
            }) ||
          function (t, e) {
            for (var i in e)
              Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
          })(e, i);
      };
      return function (e, i) {
        function o() {
          this.constructor = e;
        }
        if ("function" != typeof i && null !== i)
          throw new TypeError(
            "Class extends value " + String(i) + " is not a constructor or null"
          );
        t(e, i),
          (e.prototype =
            null === i
              ? Object.create(i)
              : ((o.prototype = i.prototype), new o()));
      };
    })(),
  WorldCupSingleDialog = (function (t) {
    function e() {
      var e = t.call(this) || this;
      return (
        e.btn_single_wc_jingcai.on(
          Laya.Event.CLICK,
          e,
          e.onDidWorldCupSingleJingCaiAction
        ),
        WebSocketService.addListener({
          caller: e,
          code: 221125,
          method: e.onLoadSingleWorldCupData,
        }),
        e
      );
    }
    return (
      __extends(e, t),
      (e.showWorldCupDialog = function (t) {
        return (
          null == this.worldCupDialog &&
            ((this.worldCupDialog = new e()),
            (this.worldCupDialog.zOrder = 100)),
          this.worldCupDialog.popup(),
          (this.worldCupDialog.objDict = t),
          this.worldCupDialog.initData(t),
          this.worldCupDialog
        );
      }),
      (e.prototype.initData = function (t) {
        (this.text_single_wc_zhudingwin.text = ""),
          (this.text_single_wc_zhudingping.text = ""),
          (this.text_single_wc_zhudinglose.text = ""),
          (this.text_betForGoals_0_1.text = ""),
          (this.text_betForGoals_2_3.text = ""),
          (this.text_betForGoals_4_6.text = ""),
          (this.text_betForGoals_7.text = ""),
          void 0 != t &&
            ((this.label_worldcup_dg_title.text =
              t.homeTeam + "VS" + t.guestTeam),
            (this.label_zhudui_win_rate.text = "(" + t.winOdds + ")"),
            (this.label_zhudui_ping_rate.text = "(" + t.evenOdds + ")"),
            (this.label_zhudui_lose_rate.text = "(" + t.loseOdds + ")"),
            (this.labe_item_0_1.text = "(" + t.goals_num_0_1 + ")"),
            (this.labe_item_2_3.text = "(" + t.goals_num_2_3 + ")"),
            (this.labe_item_4_6.text = "(" + t.goals_num_4_6 + ")"),
            (this.labe_item_7.text = "(" + t.goals_num_7 + ")"));
      }),
      (e.prototype.onDidWorldCupSingleJingCaiAction = function () {
        var t = "0",
          e = "0",
          i = "0",
          o = "0",
          _ = "0",
          n = "0",
          l = "0";
        if (
          (this.text_betForGoals_0_1.text.length > 0 &&
            (o = this.text_betForGoals_0_1.text),
          this.text_betForGoals_2_3.text.length > 0 &&
            (_ = this.text_betForGoals_2_3.text),
          this.text_betForGoals_4_6.text.length > 0 &&
            (n = this.text_betForGoals_4_6.text),
          this.text_betForGoals_7.text.length > 0 &&
            (l = this.text_betForGoals_7.text),
          this.text_single_wc_zhudingwin.text.length > 0 &&
            (t = this.text_single_wc_zhudingwin.text),
          this.text_single_wc_zhudingping.text.length > 0 &&
            (e = this.text_single_wc_zhudingping.text),
          this.text_single_wc_zhudinglose.text.length > 0 &&
            (i = this.text_single_wc_zhudinglose.text),
          "0" != t ||
            "0" != e ||
            "0" != i ||
            "0" != o ||
            "0" != _ ||
            "0" != n ||
            "0" != l)
        ) {
          var s = this.objDict.homeTeam,
            r = this.objDict.matchId;
          WebSocketService.send({
            c: 221125,
            d: {
              matchId: r,
              homeTeam: s,
              betForWin: t,
              betForEven: e,
              betForLose: i,
              betForGoals_0_1: o,
              betForGoals_2_3: _,
              betForGoals_4_6: n,
              betForGoals_7: l,
            },
          });
        } else ToastView.toastView("请先下注哦~");
      }),
      (e.prototype.onLoadSingleWorldCupData = function (t) {
        ToastView.toastView(t.msg), this.close();
      }),
      e
    );
  })(ui.ActivityController.WorldCupSingleDialogUI);
